<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
 <div id="app">
    <h1>渣浪.com</h1>

    <p>
        <router-link to="/home">go to home</router-link>
        <router-link to="/news">go to news</router-link>

    </p>
    <router-view></router-view>
 </div>
    

</body>
<script src="./js/vue-router.min.js"></script>
<script src="./js/vue.min.js"></script>
<script>
    const home = {template:"<div> 首页 </div>"};
    const news = {template:"<div> 新闻 </div>"};
    const routes = [
        {path:"/home", component: home},
        {paht:"/news", component: news}
    ];
    const router = new VueRouter({
        routes: routes,
    });
    var VM = new Vue({
        router
    }).$mount("#app"); //代替el
</script>
</html>